<template>
    <div>
      <div class="banner" @click="handleClickBanner">
        <img class="banner-img" :src="bannerImg" alt="">
        <div class="banner-info">
          <div class="banner-title">{{sightName}}</div>
          <div class="banner-number">
            <span class="iconfont banner-icon">&#xe621;</span>
            {{this.gallaryImgs.length}}
          </div>
        </div>
      </div>
      <common-gallary :imgs="gallaryImgs" v-show="showGallary"  @close="handleImgOut"></common-gallary>
    </div>
</template>
<script>
import CommonGallary from 'common/gallary/Gallary'
export default {
  name: 'Banner',
  props: {
    bannerImg: String,
    gallaryImgs: Array,
    sightName: String
  },
  data () {
    return {
      imgs: ['http://img1.qunarzz.com/sight/p0/1411/13/0cd5a9a57ae0d1b9b935ec604ce0f9bf.water.jpg_r_800x800_9773cfee.jpg', 'http://img1.qunarzz.com/sight/p0/1706/f8/f88683e4a602c7c3a3.img.jpg_r_800x800_e18b3f15.jpg', 'http://img1.qunarzz.com/sight/p0/1706/9b/9b6ce141d1a23b30a3.img.jpg_r_800x800_24dbd8cb.jpg'],
      showGallary: false
    }
  },
  methods: {
    handleClickBanner: function () {
      this.showGallary = true
    },
    handleImgOut: function () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary
  }
}
</script>
<style scoped lang="stylus">
.banner
  overflow:hidden
  height:0
  background:#999
  padding-bottom:55%
  position:relative
  .banner-img
    width:100%
  .banner-info
    background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.8));
    display:flex
    position:absolute
    left:0
    right:0
    bottom:0
    line-height:.46rem;
    color:#fff
    .banner-title
      flex:1
      padding-left:.2rem
    .banner-number
      padding:0 .4rem
      background:rgba(0,0,0,.6)
      border-radius:.12rem
      line-height:.38rem;
      height:.38rem
      margin-right:.08rem;
</style>
